package bos.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import bos.dao.IDecidedzoneDao;
import bos.dao.ISubareaDao;
import bos.domain.Decidedzone;
import bos.domain.Subarea;
import bos.service.IDecidedzoneService;
import bos.utils.PageBean;

@Service
@Transactional
public class DecidedzoneServiceImpl implements IDecidedzoneService {
@Autowired
private IDecidedzoneDao decidedzoneDao;
@Autowired
private ISubareaDao subareaDao;

	@Override
	public void save(Decidedzone model, String[] subareaid) {
		decidedzoneDao.save(model);
		for(String sid:subareaid){
			Subarea subarea=subareaDao.findById(sid);
			
			subarea.setDecidedzone(model);
			
		}
		
	}

	@Override
	public void pageQuery(PageBean pageBean) {
		decidedzoneDao.pageQuery(pageBean);
	}

}
